import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { usePermission } from '/@/hooks/web/usePermission';
const { hasPermission } = usePermission();
//列表数据
export const columns : BasicColumn[] = [
	{
		title: '租户',
		align: "center",
		dataIndex: 'tenantId_dictText',
		ifShow: () => {
			return hasPermission('pick_up_point:show');
		},

	},
	{
		title: '经纬度',
		align: "center",
		dataIndex: 'lotAndLat'
	},
	{
		title: '地址',
		align: "center",
		dataIndex: 'address'
	},
	{
		title: '城市',
		align: "center",
		dataIndex: 'cityId_dictText'
	},
	{
		title: '选择次数',
		align: "center",
		sorter: true,
		dataIndex: 'selcetNum'
	},
	{
		title: '上车人数',
		align: "center",
		sorter: true,
		dataIndex: 'upCartNum'
	},
];
//查询数据
export const searchFormSchema : FormSchema[] = [
	{
		label: "租户",
		field: 'tenantId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sys_tenant,name,id"
		},
		ifShow: () => {
			return hasPermission('pick_up_point:show');
		},
		//colProps: {span: 6},
	},
	{
		label: "地址",
		field: 'address',
		component: 'Input',
		//colProps: {span: 6},
	},
];
//表单数据
export const formSchema : FormSchema[] = [
	{
		label: '经纬度',
		field: 'lotAndLat',
		component: 'Input',
		slot: 'lotAndLat'
	},
	{
		label: '地址',
		field: 'address',
		component: 'InputTextArea',
	},
	{
		label: '城市',
		field: 'cityId',
		component: 'JTreeDict',
		componentProps: { async: true,parentCode:'A02'},
	},
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData) : FormSchema[] {
	// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
	return formSchema;
}